package com.signway.javaui.base;

import com.signway.javaui.utils.SwLog;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;

public abstract class BaseAbilitySlice extends AbilitySlice {
    private static AbilitySlice abilitySlice = null;

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        abilitySlice = this;

        SwLog.debug(this, "onStart");
    }

    @Override
    protected void onForeground(Intent intent) {
        super.onForeground(intent);
        abilitySlice = this;

        SwLog.debug(this, "onForeground");
    }

    @Override
    protected void onActive() {
        super.onActive();
        abilitySlice = this;

        SwLog.debug(this, "onActive");
    }

    @Override
    protected void onInactive() {
        super.onInactive();
        SwLog.debug(this, "onInactive");
    }

    @Override
    protected void onBackground() {
        super.onBackground();
        SwLog.debug(this, "onBackground");
    }

    @Override
    protected void onStop() {
        super.onStop();
        SwLog.debug(this, "onStop");
    }

    public static AbilitySlice getTopAbilitySlice() {
        return abilitySlice;
    }
}
